<%-- 
    Document   : user_name
    Created on : 21.04.2013, 2:46:24
    Author     : Yasya,Svetlana Shikhutskaya
--%>

<%@page import="delta.cart.bean.CartLocal"%>
<%@page import="entity.Users"%>
<%@page contentType="text/html" pageEncoding="UTF-8" errorPage="main.jsp"%>
<%
    CartLocal cart = (CartLocal) session.getAttribute("cart");
    Users user = (Users) session.getAttribute("user");
    session.setAttribute("pageNumber", null);
    session.setAttribute("sortBy", null);
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="css/user.css">
         <link rel="stylesheet" type="text/css" href="css/all.css">
        <script type="text/javascript" src="scripts/jquery-1.8.3.min.js"></script>
        <script type="text/javascript" src="scripts/user-dashboard.js"></script>
        <script type="text/javascript" src="scripts/admin.js"></script>
        <title>our_product</title>
    </head>
    <body>
        <header>
            <div id ="top_name"> <a href="main.jsp"> <img src="/Delta-war/product/1.jpeg"></a>
                <h1><%=user.getLogin()%></h1> </div>
            
            <div id="registr2">
                    <a href="logout">Logout</a> 
                </div>
                <div id ="shopping">    
                    <a href="cart_user.jsp">Cart</a>                     
                     <input type="text" name="Count_product" size="1" readonly value="<%=cart.getCount()%>" /> products
                </div>
                <div id="price_shopping"> <input type="text" name="Prcie" size="8" readonly value="<%=cart.getTotalPrice()%>" /> $  
                </div>
                
            
        </header>
        <div id="main">
            <div id="menu">
                <ul>
                    <li><a href="user_name.jsp">Profile</a></li>
                    <li><a href="order_history.jsp">Order history</a></li>
                </ul>
            </div>

            <div id="label">
                <p> First name<span style="color: red">*</span></p> 
                <p> Last name <span style="color: red">*</span></p>
                <p> E-mail</p>
                <p> Address<span style="color: red">*</span></p>
            </div>

            <form class="js-edit-user-info" method="POST">
                <div id="text"> 
                    <p> <input type="text" id="First_Name" oninput="checkInfo()" name="First_name" maxlength="100" size="45" value="<%=user.getFirstName()%>"/><span id="warningFName" style="color: red"></span><br>
                        <input type="text" id="Last_Name" oninput="checkInfo()" name="Last_name" maxlength="100" size="45" value="<%=user.getLastName()%>"/><span id="warningLName" style="color: red"></span><br>
                        <% String email = user.getEMail();
                            if (email == null) {
                                email = "";
                            }
                        %>
                        <input type="text" id="e-mail" oninput="checkInfo()" name="E-mail" maxlength="100" size="45" value="<%=email%>"/><span id="warningEmail" style="color: red"></span><br>
                        <input type="text" id="Address" oninput="checkInfo()" name ="Address" maxlength="300" size="45" value="<%=user.getAddress()%>"/><span id="warningAddress" style="color: red"></span></p>
                    <span id="warning" style="color: red; position: relative; bottom: 20px;"></span><br>
                    <label style="color: #6699FF" id="arrow">&#9658</label><button id="btn-change-password">Change password</button>
                </div>
                <button id="ok" type="submit">Ok</button>
            </form> 
            <div id="change-user-password" style="display: none">
                <div id="label1">
                    <p> Old password <span style="color: red">*</span></p> 
                    <p> New password <span style="color: red">*</span></p>
                    <p> Confirmation <span style="color: red">*</span></p>
                </div>

                <form method="POST" action="user_name.jsp">
                    <div id="text1"> 
                        <p> 
                            <input id="old-password" oninput="checkPasswords()" type="password" name="Old_pass" size="25"/><br>
                            <input id="new-password" oninput="checkPasswords()" type="password" name="New_pass" size="25"/><br>
                            <input id="confirmation" oninput="checkPasswords()" type="password" name ="Repeat_pass" size="25"/>
                            <span id="warningConfirm" style="color: red;margin-left: 10px"></span><br>
                            <span id="warningPassword" style="color: red">Fill all the fields</span><br><br>
                        </p>
                    </div>
                    <button id="save" type="submit" disabled="true">Save</button> 
                    <div id="line"> <hr></div>
                </form>
            </div>
        </div>
                     <div id="footer1">
                                <p>  &#169;All rights reserved</p>
                            </div>
    </body>
</html>
